//
//  OperationCollectionViewCell.m
//  BaseProject
//
//  Created by itzhaolei on 2024/5/13.
//

#import "OperationCollectionViewCell.h"

@interface OperationCollectionViewCell()

@end

@implementation OperationCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self addSubviews];
        [self addConstraints];
        [self addActions];
    }
    return self;
}

#pragma mark - Add
- (void)addSubviews {
    [self.contentView addSubview:self.reloadC1Button];
    [self.contentView addSubview:self.reloadAllButton];
}

#pragma mark - Constraints
- (void)addConstraints {
    [self.reloadC1Button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.leading.equalTo(self.contentView).offset(15);
        make.trailing.equalTo(self.contentView).offset(-15);
        make.height.mas_equalTo(44);
    }];
    [self.reloadAllButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.reloadC1Button.mas_bottom).offset(15);
        make.leading.equalTo(self.contentView).offset(15);
        make.trailing.equalTo(self.contentView).offset(-15);
        make.height.mas_equalTo(44);
    }];
}

#pragma mark - Actions
- (void)addActions {}

#pragma mark - Lazy
- (QMUIButton *)reloadC1Button {
    if (!_reloadC1Button) {
        QMUIButton *view = [[QMUIButton alloc] init];
        [view setTitle:@"点击跨区刷新B区数据" forState:(UIControlStateNormal)];
        [view setTitleColor:[UIColor qmui_colorWithHexString:@"#000000"] forState:(UIControlStateNormal)];
        view.titleLabel.font = [UIFont systemFontOfSize:18 weight:(UIFontWeightRegular)];
        view.layer.cornerRadius = 22;
        view.layer.masksToBounds = true;
        view.backgroundColor = UIColor.redColor;
        _reloadC1Button = view;
    }
    return _reloadC1Button;
}
- (QMUIButton *)reloadAllButton {
    if (!_reloadAllButton) {
        QMUIButton *view = [[QMUIButton alloc] init];
        [view setTitle:@"刷新所有区的数据" forState:(UIControlStateNormal)];
        [view setTitleColor:[UIColor qmui_colorWithHexString:@"#000000"] forState:(UIControlStateNormal)];
        view.titleLabel.font = [UIFont systemFontOfSize:18 weight:(UIFontWeightRegular)];
        view.layer.cornerRadius = 22;
        view.layer.masksToBounds = true;
        view.backgroundColor = UIColor.greenColor;
        _reloadAllButton = view;
    }
    return _reloadAllButton;
}

@end
